'use strict';
const db = uniCloud.database()
const user = db.collection('user_data')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	const data = await user.where({
		openid: event.openid
	}).field({
		avatarUrl: true,
		gender: true,
		nickName: true,
		age: true,
		mobile:true,
		height: true,
		weight: true,
		targetWeight: true,
		metabolize: true,
		signature: true,
		carbohydrate: true,
		fat: true,
		protein: true
	}).get()
	//返回数据给客户端
	return {
		code: 200,
		msg: "获取成功",
		data
	}
};